<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class MediaComment extends Model
{
    protected $table = 'media_comment';

    public function _user()
    {
        return $this->belongsTo('App\Models\User','uid');
    }

    public function _replys()   //获取子级回复
    {
        return $this->hasMany('App\Models\MediaComment','parent_id');
    }

    public function _parentComment()    //获取父级评论
    {
        return $this->hasOne('App\Models\MediaComment','id','parent_id');
    }

    public function _media()
    {
        return $this->belongsTo('App\Models\Media','media_id');
    }
}
